/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Helper;

/**
 *
 * @author Lu Xiaodi
 */
public class Helper_LineBreakConverter {
    
    //This method replaces all CRLF with <br/>
    public static String convertLineBreaks(String input){
        
        String str = "";
        
        char[] temp = input.toCharArray();
        for(int i=0;i<temp.length;i++){
            int charASCII = temp[i];
            //System.out.println(charASCII + " $$$$$$$");
            final char CR = 13;
            final char LF = 10;
            switch(charASCII){
                case CR: str = str + "<br/>"; break;
                case LF: break;
                default: str = str + temp[i]; break;
            }
        } 

        return str;
    }
    
    
    
    
}
